//
// Created by You, Zhengzhong on 8/2/24.
//

#ifndef INCLUDE_SOLVER_INTERFACE_SOLVER_CPLEX_HPP_
#define INCLUDE_SOLVER_INTERFACE_SOLVER_CPLEX_HPP_

#include "technique_control.hpp"

#if SOLVER_TYPE == 1
#include <ilcplex/cplex.h>
#include <ilcplex/cplexx.h>
#include <cstdlib>

using SOLVERmodel = CPXLPptr;
using SOLVERenv = CPXENVptr;
#define SOLVER_EQUAL 'E'
#define SOLVER_GREATER_EQUAL 'G'
#define SOLVER_LESS_EQUAL 'L'
#define SOLVER_BINARY 'B'
#define SOLVER_INTEGER 'I'
#define SOLVER_CONTINUOUS 'C'
#define SOLVER_OPTIMAL CPX_STAT_OPTIMAL
#define SOLVER_SUBOPTIMAL CPX_STAT_FEASIBLE
#define SOLVER_NUMERIC CPX_STAT_NUM_BEST
#define SOLVER_MIP_INFEASIBLE CPXMIP_INFEASIBLE
#define SOLVER_INF_OR_UNBD CPX_STAT_UNBOUNDED
#define SOLVER_UNBOUNDED CPX_STAT_UNBOUNDED
#define SOLVER_PRIMAL_SIMPLEX CPX_ALG_PRIMAL
#define SOLVER_DUAL_SIMPLEX CPX_ALG_DUAL
#define SOLVER_BARRIER CPX_ALG_BARRIER
#define SOLVER_CROSSOVER_DOWN CPX_NONBASIC_SOLN //special care, since this is the sign for shutting down crossover
#define SOLVER_CROSSOVER_DEFAULT  0
#define SOLVER_MAX_SENSE CPX_MAX
#define SOLVER_TIME_LIMIT CPX_PARAM_TILIM
#define SOLVER_INFINITY CPX_INFBOUND
#endif

#endif //INCLUDE_SOLVER_INTERFACE_SOLVER_CPLEX_HPP_
